﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="WebSiteTMS.Pages.Users" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="../Resources/css/users.css"/>
    <script type="text/javascript" src="../Resources/js/bootstrap.js"></script>
    <script type="text/javascript" src="../Resources/js/users.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content">
        <div class="submenu">
          <ul id="sumbmenuUl">
              <li class="item" id="usersSubmenu"><a href="Users.aspx?selectedItem=allUsers"><%=Resources.Users.allUsersTab %></a></li>
              <li class="item" id="myTeams"><a href="Users.aspx?selectedItem=myTeams"><%=Resources.Users.myTeamsTab %></a></li>
          </ul>
        </div>
        <div class="hTxt"><%= Resources.Users.title %></div>
        <% if (Request.Url.AbsoluteUri.Contains("?selectedItem=allUsers"))
           { %>
        <span><b><%= Resources.Users.selectUsers %></b></span>
        <select id="userSelection">
            <option value="1"><%= Resources.Users.allOption %></option>
            <option value="2"><%= Resources.Users.adminOption %></option>
            <option value="3"><%= Resources.Users.managerOption %></option>
            <option value="4"><%= Resources.Users.developerOption %></option>
            <option value="5"><%= Resources.Users.testerOption %></option>
        </select>
        <br/><br/>
        <% if (Request.Cookies["userS"].Value == "Admin")
           { %>
        <div class="divButton">
            <button id="addUserBtn1" class="button" onclick=""><%= Resources.Users.addUserBtn %></button>
        </div>
        <% } %>
        <table cellspacing="0" id="userTable">
            <tr class="userTableHeader">
                <th style="width: 75px;"><%= Resources.Users.numberTable %></th>
                <th style="text-align: left; width: 120px;"><%= Resources.Users.nameTable %></th>
                <th style="text-align: left; width: 120px;"><%= Resources.Users.surnameTable %></th>
                <th style="text-align: left; width: 160px;"><%= Resources.Users.patronymicTable %></th>
                <th style="text-align: left; width: 230px;"><%= Resources.Users.emailTable %></th>
                <th style="text-align: left; width: 110px;"><%= Resources.Users.loginTable %></th>
                <th style="text-align: left; width: 100px;"><%= Resources.Users.roleTable %></th>
                <th><%= Resources.Users.editTable %></th>
                <th><%= Resources.Users.deleteTable %></th>
            </tr>
        </table>
        <% if (Request.Cookies["userS"].Value == "Admin")
           { %>
        <div class="divButton">
            <button id="addUserBtn2" class="button" onclick=""><%= Resources.Users.addUserBtn %></button>
        </div>
        <% } %>
    <% }
       else if (Request.Url.AbsoluteUri.Contains("?selectedItem=myTeams"))
       { %>
        <script type="text/javascript">
            var numberTable = '<%= Resources.Users.numberTable %>';
            var nameTable = '<%= Resources.Users.nameTable %>';
            var surnameTable = '<%= Resources.Users.surnameTable %>';
            var phoneTable = '<%= Resources.Users.nameTable %>';
            var emailTable = '<%= Resources.Users.emailTable %>';
            var loginTable = '<%= Resources.Users.loginTable %>';
            var roleTable = '<%= Resources.Users.roleTable %>';
            var noTeams = '<%= Resources.Users.noTeams %>';
            var noUserInTeam = '<%= Resources.Users.noUserInTeam %>';
        </script>
        <% if (Request.Cookies["userS"].Value == "Admin")
           { %>
        <span><b><%= Resources.Users.teamSelection %></b></span>
        
        <select id="teamSelection">
            <option value="1"><%=Resources.Users.allTeamsOption %></option>
            <option value="2"><%=Resources.Users.myTeamsTab %></option>
        </select>
        <% } %>
        <div id="myTeamsContents"></div>
    <% } %>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div id="usersOverlay" class="overlay"></div>
    <div id="addUserPop">
        <div id="closeAddUserPop" class="closePop"></div>
        <div class="headTxt" id="addUserPopHeadTxt"><%=Resources.Users.addUserHeader %></div>
        <div class="headLine"></div>
        <div class="beforeInputTxt" id="nameTxt"><%=Resources.Users.namePop %></div>
        <input type="text" maxlength="30" id="nameBox" class="inputField"/>
        <div class="beforeInputTxt" id="snameTxt"><%=Resources.Users.snamePop %></div>
        <input type="text" maxlength="30" id="snameBox" class="inputField"/>
        <div class="beforeInputTxt" id="patronymicTxt"><%=Resources.Users.patronymicPop %></div>
        <input type="text" maxlength="30" id="patronymicBox" class="inputField"/>
        <div class="beforeInputTxt" id="loginTxt"><%=Resources.Users.loginPop %></div>
        <input type="text" maxlength="30" id="loginBox" class="inputField"/>
        <div class="beforeInputTxt" id="passwordTxt"><%=Resources.Users.passPop %></div>
        <input type="password" maxlength="30" id="passwordBox" class="inputField"/>
        <div class="beforeInputTxt" id="cpasswordTxt"><%=Resources.Users.cpassPop %></div>
        <input type="password" maxlength="30" id="cpasswordBox" class="inputField"/>
        <div class="beforeInputTxt" id="emailTxt"><%=Resources.Users.emailPop %></div>
        <input type="text" maxlength="30" id="emailBox" class="inputField"/>
        <div class="beforeInputTxt" id="roleTxt"><%=Resources.Users.selectRole %></div>
        <select id="roles">
            <option value="1"><%=Resources.Users.adminOption %></option>
            <option value="2"><%=Resources.Users.managerOption %></option>
            <option value="3"><%=Resources.Users.developerOption %></option>
            <option value="4"><%=Resources.Users.testerOption %></option>
        </select>
        <input type="hidden" id="userIdToEdit"/>
        <button id="addBtn" class="button" data-loading-text="Processing"><%=Resources.Users.addUserBtnTxt %></button>
        <button id="editBtn" class="button" data-loading-text="Processing"><%=Resources.Users.editUserBtnTxt %></button>
    </div>
    
    <div id="removePop">
        <div id="closeRemovePop" class="closePop"></div>
        <div id="removeHeader"><%=Resources.Users.deleteUserHeaderTxt %></div>
        <div id="removeTxt"></div>
        <input type="hidden" id="userId"/>
        <button id="cancelRemovePopBtn" class="button"data-loading-text="Cancel"><%=Resources.Users.cancelTxt %></button>
        <button id="removeBtn" class="button" data-loading-text="Processing"><%=Resources.Users.deleteTable %></button>
    </div>
</asp:Content>
